Skip to content

Conversation

jkawan
Copy link
Contributor

@jkawan jkawan commented Jul 28, 2025

  1. Implemented ToPlutusData() for GovAnchor, GovActionId, ProposalProcedure, GovActionWrapper, ParameterChangeGovAction, HardForkInitiationGovAction, TreasuryWithdrawalGovAction, NoConfidenceGovAction, UpdateCommitteeGovAction, NewConstitutionGovAction, InfoGovAction
  2. Added unit tests for all the ToPlutusData() implemented above.

Closes #1106

@jkawan jkawan requested a review from a team as a code owner July 28, 2025 21:54
if rat := a.Unknown; rat != (cbor.Rat{}) {
val := reflect.ValueOf(rat)
numField := val.FieldByName("num")
denField := val.FieldByName("den")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The big.Rat type (and cbor.Rat which embeds it) have a .Num() and .Denom() function for extracting these values

ActionId *GovActionId
Credentials []Credential
CredEpochs map[*Credential]uint
Unknown cbor.Rat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're here, rename this field to Quorum, since we can now see what it's supposed to be from looking at the Aiken code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed the comments, could you please review

@agaffney agaffney merged commit 90d2a6d into main Jul 29, 2025
8 checks passed
@agaffney agaffney deleted the gov-proposal branch July 29, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ToPlutusData() function to gov proposal-related types
2 participants